#include "HomeManager.h"
#include "ResourcesManager.h"
#include "ConfigManager.h"

HomeManager::HomeManager()
{
    numHp = ConfigManager::Instance().num_initial_hp;
}

double HomeManager::GetCurrentHpNumber() const
{
    return numHp;
}

void HomeManager::DecreaseHp(double val)
{
    numHp -= val;
    if (numHp < 0) {
        numHp = 0;
    }
    static ResourcesManager::SoundPool& soundPool = ResourcesManager::Instance().soundPool;
    Mix_PlayChannel(-1, soundPool[ResID::Sound_HomeHurt], 0);
}